﻿using NbMeterServices.Entity;
using SqlSugar;
using System.ComponentModel.DataAnnotations;

/// <summary>
/// 仪表信息
/// </summary>
[SugarTable("MR_Meter", "仪表信息")]
public class MrMeter
{
    /// <summary>
    /// 雪花Id
    /// </summary>
    [SugarColumn(ColumnName = "Id", ColumnDescription = "主键Id", IsPrimaryKey = true, IsIdentity = false)]
    public long Id { get; set; }

    /// <summary>
    /// 仪表编号
    /// </summary>
    [SugarColumn(ColumnName = "MeterNo", ColumnDescription = "仪表编号", Length = 32)]
    public string? MeterNo { get; set; }

    /// <summary>
    /// ICCID
    /// </summary>
    [SugarColumn(ColumnName = "ICCID", ColumnDescription = "ICCID", Length = 32)]
    public string? ICCID { get; set; }

    /// <summary>
    /// 仪表类型
    /// </summary>
    [SugarColumn(ColumnName = "MeterType", ColumnDescription = "MeterType", Length = 32)]
    public string? MeterType { get; set; } 

    /// <summary>
    /// 创建时间
    /// </summary>
    [SugarColumn(ColumnDescription = "创建时间", IsOnlyIgnoreUpdate = true)]
    public virtual DateTime? CreateTime { get; set; }

    /// <summary>
    /// 仪表状态
    /// </summary>
    [SugarColumn(ColumnName = "State", ColumnDescription = "仪表状态")]
    public short? State { get; set; }

    /// <summary>
    /// 创建者姓名
    /// </summary>
    [SugarColumn(ColumnDescription = "创建者姓名", Length = 64, IsOnlyIgnoreUpdate = true)]
    public string? CreateUserName { get; set; } = "system";

    /// <summary>
    /// 绑定类型
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "BindingType", ColumnDescription = "绑定类型")]
    public int BindingType { get; set; }

    /// <summary>
    /// 所属信息
    /// </summary>
    [Required]
    [SugarColumn(ColumnName = "OwnerId", ColumnDescription = "所属信息")]
    public long OwnerId { get; set; } = 0;

    /// <summary>
    /// 软删除
    /// </summary>
    [SugarColumn(ColumnDescription = "软删除")]
    public bool IsDelete { get; set; } = false;

    /// <summary>
    /// 租户Id
    /// </summary>
    [SugarColumn(ColumnName = "TenantId", ColumnDescription = "租户Id")]
    public long? TenantId { get; set; } = 1300000000001;


    /// <summary>
    /// 安装日期
    /// </summary>
    [SugarColumn(ColumnName = "InstallDate", ColumnDescription = "安装日期")]
    public DateTime? InstallDate { get; set; } = DateTime.Now.Date;


    /// <summary>
    /// 通讯状态
    /// </summary>
    [SugarColumn(ColumnDescription = "通讯状态")]
    public bool? ComState { get; set; } = false;

    /// <summary>
    /// 上报周期
    /// </summary>
    [SugarColumn(ColumnName = "Cyc", ColumnDescription = "上报周期")]
    public int? Cyc { get; set; }    
}